package com.ominext.home;

import java.io.File;
import java.io.IOException;

import uk.co.senab.photoview.PhotoViewAttacher;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Matrix;
import android.media.ExifInterface;
import android.os.Bundle;
import android.util.Log;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.ominext.beautifulcapture.R;
import com.ominext.utils.DeviceUtils;
import com.ominext.utils.ImageUtils;

public class ShowImage extends Activity {

	ImageView mImageShow;
	static final String PHOTO_TAP_TOAST_STRING = "Photo Tap! X: %.2f %% Y:%.2f %%";

	private ImageView mImageView;

	private PhotoViewAttacher mAttacher;

	private String imgPath;

	private File imgFile;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		setContentView(R.layout.show_image);

		mImageView = (ImageView) findViewById(R.id.imageShow);

		imgPath = Path.imageShowPath;
		imgFile = new File(imgPath);

		// convert image to bitmap
		if (imgFile.exists()) {
			BitmapFactory.Options options = new BitmapFactory.Options();
			options.inSampleSize = 2;
			Bitmap myBitmap = BitmapFactory.decodeFile(
					imgFile.getAbsolutePath(), options);

			//sssmyBitmap = ImageUtils.rotate(imgPath);
			
			mImageView.setImageBitmap(myBitmap);
		}

		mAttacher = new PhotoViewAttacher(mImageView);
		mAttacher.update();
	}
}
